How to solve the Santa Claus problem

نویسنده

  • Mordechai Ben-Ari
چکیده

John Trono published a new exercise in concurrent programming—the Santa Claus problem—and provided a solution based on semaphores [12]. His solution is incorrect because it assumes that a process released from waiting on a semaphore will necessarily be scheduled for execution. We give a simple solution in Ada 95 using higher order synchronization primitives: protected objects and rendezvous. We then give solution in Java, though this solution is not as elegant as the Ada 95 solution because the Java synchronization primitives are rather limited. The problem demonstrates that semaphores, designed for low-level mutual exclusion, are not appropriate for solving difficult concurrent programming problems.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Solving the Santa Claus Problem: a Comparison of Various Concurrent Programming Techniques

The Santa Claus problem provides an excellent exercise in concurrent programming and can be used to show the simplicity or complexity of solving problems using a particular set of concurrency mechanisms and offers a comparison of these mechanisms. Shared-memory constructs, message passing constructs, and process oriented constructs will be used in various programming languages to solve the Sant...

متن کامل

The Santa Claus Problem in a Probabilistic Setting

In this paper we consider the Santa Claus problem. Santa Claus has n presents, which he wants to give to m children. Santa’s objective is to distribute the presents such that in the end the least happy child is as happy as possible. The Santa Claus problem is equivalent to the problem of scheduling a set of n jobs on m parallel machines without preemption, so as to maximize the minimum load. He...

متن کامل

Jingle Bells: Solving the Santa Claus Problem in Polyphonic C

The Santa Claus problem is an interesting exercise in concurrent programming which has been used in a comparison of the concurrency mechanisms of Ada and Java. We present a simple solution to the problem in Polyphonic C , an extension of C with new concurrency constructs based on the Join calculus.

متن کامل

Dispelling the nice or naughty myth: retrospective observational study of Santa Claus

OBJECTIVE  To determine which factors influence whether Santa Claus will visit children in hospital on Christmas Day. DESIGN  Retrospective observational study. SETTING  Paediatric wards in England, Northern Ireland, Scotland, and Wales. PARTICIPANTS  186 members of staff who worked on the paediatric wards (n=186) during Christmas 2015. MAIN OUTCOME MEASURES  Presence or absence of Sant...

متن کامل

How to Escape Irrelevance: Performance Philosophy, Public Philosophy and Borderless Philosophy

 Carlo Cellucci has rightly pointed out that contemporary professional academic philosophy has a serious problem of irrelevance. Performance philosophy and public philosophy are two recent attempts to solve that problem and radically transform professional academic philosophy into what I call real philosophy. Nevertheless, performance philosophy and public philosophy have some prima facie probl...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Concurrency - Practice and Experience

دوره 10  شماره 

صفحات  -

تاریخ انتشار 1998